package lesson4.api.base;

import lesson4.api.ApplicationManager;
import lesson4.api.helpers.NavigationHelper;
import lesson4.api.helpers.PageHelper;
import lesson4.api.helpers.WebElementHelper;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;


public class TestBase
{
	// Logger
	private static Logger log = LoggerFactory.getLogger(WebElementHelper.class);
	// Application manager instance
	protected static ApplicationManager app;

	@BeforeTest
	public void setUp() throws Exception
	{
		log.debug("Initialize the test");
		app = new ApplicationManager();
		app.init();
	}

	@AfterTest
	public void tearDown()
	{
		log.debug("Stop the test");
		app.stop();
	}

	public NavigationHelper navigation()
	{
		return app.navigation();
	}

	public PageHelper page()
	{
		return app.page();
	}

}
